package com.leff.cards.request;

import com.leff.cards.Dictionary;


public abstract class Request {
	
	protected Dictionary mDictionary;
	
	public Request(Dictionary dict) {
		mDictionary = dict;
	}

	protected final RequestResult verifyRequiredParameters(String ... params) {
		
		RequestResult res = new RequestResult();
		
		for(String P : params) {
			Object S = mDictionary.get(P);
			if(S == null) {
				res.setErrorResult("Missing parameter: " + P);
				break;
			}
		}
		return res;
	}
	
	public class Parameter {
		public static final String VERSION = "v";
		public static final String ID = "id";
		public static final String NAME = "name";
		public static final String FB_ID = "fbid";
		public static final String GROUP_ID = "group_id";
		public static final String JOIN = "join";
		public static final String CARD_IDS = "card_ids";
		public static final String GCM_ID = "gcm_id";
		public static final String UPGRADE = "upgrade";
		public static final String LAST_LOGIN = "last_login";
	}
}
